<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class FirmProfile extends Model
{
    protected $fillable = [
        'firm_id',
        'banners',
        'video_url',
        'invest_amount',
        'join_in_fee',
        'store_num',
        'set_up_time',
        'cooperation_area',
        'manage_method',
        'invest_crowd',
        'tags',
        'is_face',
        'cover_one',
        'cover_two',
        'intro',
        'advantage',
        'contact'
    ];

    protected $casts = [
        'banners' => 'array',
        'tags' => 'array',
        'cooperation_area' => 'array',
        'contact' => 'array'
    ];


    public function getIntroAttribute($value)
    {
        return str_replace("<img ", "<img style='width:100%;height:100%;vertical-align:middle;' ",$value);
    }


    public function getAdvantageAttribute($value)
    {
        return str_replace("<img ", "<img style='width:100%;height:100%;vertical-align:middle;' ",$value);
    }

}
